<template>
    <div class="common-layout">
        <el-container>
            <el-main>
                <el-tabs v-model="activeName" class="demo-tabs" @tab-change="change">
                    <el-tab-pane label="吾股" name="wugu">
                        <Wugu v-if="activeName === 'wugu'"></Wugu>
                    </el-tab-pane>
                    <el-tab-pane label="吾股历史" name="wuguHistories">
                        <WuguHistories v-if="activeName === 'wuguHistories'"></WuguHistories>
                    </el-tab-pane>
                </el-tabs>
            </el-main>
        </el-container>
    </div>
</template>

<script setup>
import { ref } from 'vue'

import Wugu from '../components/Wugu.vue';
import WuguHistories from '../components/WuguHistories.vue';

document.title = "吾股";
const activeNameKey = "WuguActiveName"
const activeName = ref(sessionStorage.getItem(activeNameKey) || 'wugu')

const change = (tabName) => {
    sessionStorage.setItem(activeNameKey, tabName)
}
</script>
